package cmsc427.mw5;

import android.content.Context;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class TrainingSet {
	public java.util.List<RawTrainingValues> values;
	public int error = 0;
	public int getSize(){
		return this.values.size();
	}
	
	/**
	 * fills the training set from our recorded data -- hard coded to save time
	 */
	TrainingSet(Context context){
		this.values = new java.util.ArrayList<RawTrainingValues>(0);
		this.values.clear();
		
		try{   
	        BufferedReader fileInput = new BufferedReader(new InputStreamReader(context.getResources().openRawResource(R.raw.acceleromoter_data)));
	        String line = fileInput.readLine();
	        
	        while(line != null){
	        	this.values.add( new RawTrainingValues(line) );
	        	line = fileInput.readLine();
	        }
	        
	        fileInput.close();
	    }
	    catch (Exception e){error = -1;}
	}
}

